package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import cn.wolfcode.luowowo.common.domain.WendaAnswerComment;
import cn.wolfcode.luowowo.member.domain.UserInfo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Getter@Setter
public class WendaAnswer extends BaseDomain {
    //0 禁用 1 待审核 2 发布状态
    public static final int STATE_REJECT = 0;
    public static final int STATE_WAITING = 1;
    public static final int STATE_RELEASE = 2;

    private Long questionId;        //关联问题的id
    private String coverUrl;        //回答的封面
    private String summary;         //摘要信息
    private UserInfo author;        //关联的用户
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;        //创建时间
    private Integer replyNum=0;     //评论数
    private Integer thumbupNum=0;   //点赞数
    private Integer state=STATE_WAITING;    //回答的默认状态是待审核
    private WendaAnswerContent wendaAnswerContent;
    private List<WendaAnswerComment> comments;  // 评论数据
}
